package game;

//opretter klassen Player og 3 variabler
public class Player { 

	private Account account;
	private int position;
	private String name;
	
	//Konstruerer en initialiserings værdi til Player
	public Player(String name){
		account = new Account();
		position = 1;
		this.name=name;
	}
	
	public Account getAccount()
	{
		return account;
	}
	
	public String getName()
	{
		return name;
	}
	// Spillleren flyttes og point udregnes.
	public void movePlayer(int diceSum){
		int numberOfFields = GameBoard.fields.length;
		
		if((position+diceSum)<=numberOfFields){
			position = position + diceSum;
		}
		else{
			position = position + diceSum - numberOfFields;
		}
		
	}
	
	public int getPosition(){
		return position;
	}
	
}